package com.exam.netease;

import java.util.Scanner;

/**
 * date:
 * description:
 */
public class Solution002 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine().trim();
        int len = str.length();
        int[] dp = new int[len + 1];
        dp[0] = 0;
        dp[1] = 0;
        for (int i = 2; i <= len; i++) {
            char a = str.charAt(i - 1);
            char b = str.charAt(i - 2);
            if(validate(a, b)){
                dp[i] = Math.max(dp[i - 1], dp[i - 2] + score(a) + score(b));
            }else{
                dp[i] = dp[i - 1];
            }
        }
        System.out.println(dp[len]);
    }

    public static boolean validate(char a, char b){
        return Math.abs(a - b) <= 1;
    }

    public static int score(char a){
        return a - 'a' + 1;
    }
}
